<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcPromotionsOrderlistTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_promotions_orderlist', function (Blueprint $table) {
            $table->increments('id');
            $table->decimal('total_money')->comment('应付金额');
            $table->string('order_time')->default('')->comment('下单时间');
            $table->string('cart_id')->default('')->comment('购物车id');
            $table->tinyInteger('type')->comment('订单类型[1:秒杀订单2:拼团订单3:砍价订单]');
            $table->decimal('coupon_price')->comment('优惠券金额');
            $table->tinyInteger('paid')->comment('支付状态');
            $table->integer('pay_time')->comment('支付时间');
            $table->string('pay_type')->default('')->comment('支付类型');
            $table->dateTime('add_time')->comment('创建时间');
            $table->tinyInteger('status')->comment('订单状态[-1:申请退款-2:退货成功-3:已退款0:待取货1:配送中2:已收货3:待评价]');
            $table->string('mark')->default('')->comment('备注');
            $table->string('is_del')->default('')->comment('是否删除');
            $table->integer('seckill_id')->comment('秒杀ID');
            $table->integer('bargain_id')->comment('砍价ID');
            $table->decimal('pay_postage')->comment('邮费');
            $table->string('delivery_name')->default('')->comment('快递公司');
            $table->string('delivery_type')->default('')->comment('物流类型');
            $table->string('delivery_id')->default('')->comment('快递单号');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_promotions_orderlist');
    }
}
